﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using LowLevelGraphics.Drawing.FloodFillModes;
using ImageRecognition2.MouseImageTools;

namespace ImageRecognition2.Action
{
    /// <summary>
    /// Action Flood Fill
    /// </summary>
    public class ActionFloodFill : AbstractCommand
    {
        private FloodFillTool m_FloodFillTool = null;

        /// <summary>
        /// 
        /// </summary>
        /// <param name="_floodFillMode"></param>
        public ActionFloodFill(AbstractFloodFill _floodFillMode)
        {
            this.Owner = _floodFillMode;
        }

        /// <summary>
        /// Executes this filter
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public override void Run(object sender, EventArgs e)
        {
            m_FloodFillTool = new FloodFillTool(MainFormSingleton.ActivePictureBox);
            m_FloodFillTool.FloodFillMode = (AbstractFloodFill)this.Owner;
            m_FloodFillTool.Activate();
        }

        /// <summary>
        /// Gets or sets flood fillmode
        /// </summary>
        public AbstractFloodFill FloodFillMode
        {
            get { return m_FloodFillTool.FloodFillMode; }
            set { m_FloodFillTool.FloodFillMode = value; }
        }
    }
}
